import React from 'react';
import './index.css';
import HotDetailArticle from "../../../Component/HotDetailArticle";
import Consulting from '../../../Server/Consulting';
import URL from '../../../Server/URL';
import MessageUtil from "../../../utils/MessageUtil";
export default class HotDetail extends React.Component{
    constructor(props){
        super();
        let id=props.match.params.id;

        let infos={};
        Consulting.SelectConsultingDetails(id)
        .then(response=>{
            this.setState({
                title:response.data.consultingTitle,
                time:response.data.consultingTime,
                src:URL.GetURL(response.data.consultingShowImg),
                text:response.data.consultingIntroduction,
                subtext:response.data.consultingContent
            },()=>{
                MessageUtil.HotNewsModelHidden();
                MessageUtil.ChangeHeight();
            });
        },reject=>{
        });
        this.state={
            infos
        }
    }
    render(){
        return(
            <div className="Hot_Detail_Info">
                <HotDetailArticle title={this.state.title} time={this.state.time} src={this.state.src} text={this.state.text} subtext={this.state.subtext}/>
            </div>
        )
    }
}